package pr.vodafone.sw;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;

import pr.vodafone.dao.dto.Terminales;

public class XmlParser {
	
	public XmlParser(){
		
	}

	public Terminales parsearXML (File file) throws JAXBException, FileNotFoundException{
		Terminales terminales;
		
		JAXBContext context= JAXBContext.newInstance(Terminales.class);
		Unmarshaller m= context.createUnmarshaller();
		terminales= (Terminales) m.unmarshal(new FileReader(file.getAbsoluteFile()));
		
		return terminales;
		
	}
}
